<?php

use app\common\services\StaticServices;
use yii\helpers\Url;

?>

<?= Yii::$app->view->renderFile('@app/modules/admin/views/common/tab_permissions.php', ['tab' => 'set']) ?>
<div class="panel-content">
    <table class="ui selectable celled table">
        <input type="hidden" name="_csrf" id='csrf' value="<?= Yii::$app->request->csrfToken ?>">
        <thead>
        <tr>
            <th>人员名称</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>

        <?php if ($info): ?>
            <?php foreach ($info as $item): ?>
                <tr>
                    <td><?= $item['admin_name'] ?></td>
                    <td>
                        <?php if ($item['is_role'] == 0): ?>
                            <a href="#" class="assign" data-id="<?= $item['id'] ?>">给与权限</a>
                        <?php endif; ?>
                        <a href="javascript:void (0)"><i class="trash alternate icon role_del"
                                                         data-id="<?= $item['id'] ?>"></i></a>
                    </td>
                </tr>
            <?php endforeach; ?>
        <?php else: ?>
            <tr>
                <td colspan="2">暂无数据</td>
            </tr>
        <?php endif; ?>
        </tbody>

    </table>
</div>
<script type="text/javascript">
    require(['modules/permissions/assign'], function (assign) {
        assign.add_assign()
        assign.del_role()
    })
</script>

